<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
	<th:block th:include="include :: header('会员用户列表')" />
	<th:block th:include="include :: select2-css" />
</head>

<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								<label>登录账号：</label>
								<input type="text" name="loginName" />
							</li>
							<li>
								<label>会员昵称：</label>
								<input type="text" name="nickName" />
							</li>
							<li>
								<label>手机号：</label>
								<input type="text" name="mobile" />
							</li>
							<li>
								<label>会员等级：</label>
								<input type="text" name="level" />
							</li>
							<li>
								<label>会员分组：</label>
								<input type="text" name="group" />
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
										class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
										class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:goods:export">
					<i class="fa fa-download"></i> 导出
				</a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: select2-js" />
	<script th:inline="javascript">
		var editFlag = [[${@permission.hasPermi('system:goods:edit')}]];
		var removeFlag = [[${@permission.hasPermi('system:goods:remove')}]];
		var prefix = ctx + "shop/member";
		var datas = [[${@dict.getType('sys_normal_disable')}]];
		$(function () {
			var options = {
				url: prefix + "/list",
				exportUrl: prefix + "/export",
				modalName: "会员",
				columns: [
				{
					field: 'memberId',
					title: 'uid',
					align: 'center'
				},
				{
					field: 'loginName',
					title: '登录账号',
					align: 'center'
				},
				{
					field: 'avatar',
					title: '头像',
					align: 'center',
					formatter: function (value, row, index) {
						return $.table.imageView(value);
					}
				},
				{
					field: 'nickName',
					title: '昵称',
					align: 'center'
				},
				{
					field: 'mobile',
					title: '手机号',
					align: 'center'
				},
				{
					field: 'loginIp',
					title: '最后登录ip',
					align: 'center'
				},
				{
					field: 'loginDate',
					title: '最后登录时间',
					align: 'center'
				},
				{
					field: 'status',
					title: '状态',
					align: 'center',
					formatter: function (value, item, index) {
						if (item.delFlag == 0) {
							return $.table.selectDictLabel(datas, value);
						}
						return '<span class="badge badge-inverse">已删除</span>'
					}
				},
				{
					title: '操作',
					align: 'center',
					formatter: function (value, row, index) {
						var actions = [];
						actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.memberId + '\',1200,800)"><i class="fa fa-search"></i>详情</a> ');
						return actions.join('');
					}
				}]
			};
			$.table.init(options);
		});

		function imagePreview(url) {
			layer.photos({photos: {"data": [{"src": url}]}});
		}
	</script>
</body>

</html>